﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace AutoChess
{
    //英雄操作指令,
    public class HeroRemoveMsgPackage
    { 
        //格子类型
        public GridType gridType;
        //格子Id
        public int gridIndex;
        //棋子Id
        public int chessId;
    }
    /// <summary>
    /// 英雄操作
    /// </summary>
    public class HeroOpretionMsg : OpretionMsg
    {
        public HeroRemoveMsgPackage package;
        public HeroOpretionMsg(HeroRemoveMsgPackage package) : base(OpretionType.Hero)
        {
            this.package = package;
        }

        public static HeroDisappearMsg NewHeroDisappearMsg(HeroRemoveMsgPackage package, ProtoBuf.Message.AutoChessOpType opType)
        {
            return new HeroDisappearMsg(package, opType);
        }

        public static HeroAppearMsg NewHeroAppearMsg(HeroData data, ProtoBuf.Message.AutoChessOpType opType)
        {
            return new HeroAppearMsg(data, opType);
        }
    }

    /// <summary>
    /// 英雄消失指令
    /// </summary>
    public class HeroDisappearMsg : HeroOpretionMsg
    {
        public ProtoBuf.Message.AutoChessOpType opType;
        public HeroDisappearMsg(HeroRemoveMsgPackage package, ProtoBuf.Message.AutoChessOpType opType) : base(package)
        {
            this.opType = opType;
        }
    }

    /// <summary>
    /// 添加新的英雄指令
    /// </summary>
    public class HeroAppearMsg : HeroOpretionMsg
    {
        public HeroData heroData;
        public ProtoBuf.Message.AutoChessOpType opType;
        public HeroAppearMsg(HeroData data, ProtoBuf.Message.AutoChessOpType opType) : base(null)
        {
            this.heroData = data;
            this.opType = opType;
        }
    }
}